<div id="page-wrapper">
   <div class="row">
      <div class="col-lg-12">
         <h1 class="page-header">Hệ thống site - <?=$link_system->name?></h1>
      </div>
   <!-- /.col-lg-12 -->
   </div>
   <!-- /.row -->
   <?php
   if(!$check_ava) {
      echo('Bạn không có quyền truy cập tài nguyên này');
   }else {
      if($link_system->name == 'F-Link') {
         ?>
         <div class="row">
            <table class="table table-bordered table-hover">
               <tr>
                  <th>STT</th>
                  <th>Tên site</th>
                  <th>Chủ site</th>
                  <th>Tài nguyên còn lại</th>
               </tr>
               <?php
               $i = 0;
               foreach($links as $link) {
                  $i++;
                  if($link['lin_site_type'] == 'wordpress')
                     $continue = $link['lin_link'].'/wp-content/plugins/sudo-oauth/SudoOauth.php';
                  elseif($link['lin_site_type'] == 'xenforo')
                     $continue = $link['lin_link'].'/index.php?sudo-login';
                  else 
                     $continue = $link['lin_link'].'/SudoOauth.php';
                  $arr = array('service'=>$link['lin_title'],'continue'=>$continue);
                  $arr =json_encode($arr);
                  $arr = base64_encode($arr);
                  $link_log = 'http://id.sudo.vn/dang-nhap/oauth/general?token='.$arr.'';
                  ?>
                  <tr>
                     <td><?=$i?></td>
                     <td><a href="<?=$link_log?>" target="_blank"><?=$link['lin_link']?></a></td>
                     <td><?=$link['lin_author']?></td>
                     <td><?=(10 - $link['lin_resources'])?></td>
                  </tr>
                  <?
               }
               ?>
            </table>
         </div>
         <!-- /.row -->
         <?
      }else {
         ?>
         <div class="row">
            <table class="table table-bordered table-hover">
               <tr>
                  <th>STT</th>
                  <th>Tên site</th>
                  <th>Tuổi site</th>
                  <th>Page rank</th>
                  <th>Active</th>
               </tr>
               <?php
               $i = 0;
               foreach($links as $link) {
                  $i++;
                  if($link['lin_site_type'] == 'wordpress')
                     $continue = $link['lin_link'].'/wp-content/plugins/sudo-oauth/SudoOauth.php';
                  elseif($link['lin_site_type'] == 'xenforo')
                     $continue = $link['lin_link'].'/index.php?sudo-login';
                  else 
                     $continue = $link['lin_link'].'/SudoOauth.php';
                  $arr = array('service'=>$link['lin_title'],'continue'=>$continue);
                  $arr =json_encode($arr);
                  $arr = base64_encode($arr);
                  $link_log = 'http://id.sudo.vn/dang-nhap/oauth/general?token='.$arr.'';
                  ?>
                  <tr>
                     <td><?=$i?></td>
                     <td><a href="<?=$link_log?>" target="_blank"><?=$link['lin_title']?></a></td>
                     <td><?=$link['lin_age']?></td>
                     <td><?=$link['lin_pr']?></td>
                     <td><?=$link['lin_active']?></td>
                  </tr>
                  <?
               }
               ?>
            </table>
         </div>
         <!-- /.row -->
         <?
      }
   }
   ?>
</div>
<!-- /#page-wrapper -->
<div class="clear"></div>